<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>赋值</title>
</head>

<body>
    <script>
        // let y = 10;
        // let x = y;
        // console.log(x)
        // x += y;
        // console.log(x);
        // x -= y;
        // console.log(x);
        // x *= y;
        // console.log(x);
        // x /= y;
        // console.log(x);
        // x %= y;
        // console.log(x);
        // let a = 2,
        //     b = 4;
        // a **= b;
        // console.log(a);
        //解构赋值
        // let array = [1, 2, 3];
        // let [a, b, c] = array;
        // console.log(a, b, c);
        let [a, b, ...rest] = [1, 2, 3, 4, 5, 6];
        console.log(a);
        console.log(b);
        console.log(rest);
        ({
            a,
            b
        } = {
            a: 10,
            b: 20
        });
        console.log(a);
        console.log(b);
    </script>
</body>

</html>